import { message } from 'antd'
import { Navigate } from 'react-router-dom'
export default function AuthComponent({ children }: any) {
    const isToken = localStorage.getItem('token')
    if (isToken) {
        return (
            <div>{children}</div>
        )
    } else {
        message.warning('您还没有登录请登录')
        return (<>
            <Navigate to="/login"></Navigate>
        </>)
    }
}